class student:
   #类属性
    school='北大'
    class_num='2'
    #实例化属性
    def __init__(self,name,id,sex):
        self.name=name
        self.id=id
        self.sex=sex
    #方法
    def study(self):
        print(f'{student.school}学生{self.name}正在学习')
        self.run()
    def run(self):
        print(f'学生{self.name}正在跑步')

tom=student('tom',1,'男')
print(tom.school)
print(tom.sex)
tom.run()
tom.study()
tom.name='汤姆'
print(tom.name)

class people:
    country='中国'
    def __init__(self,name,sex,province):
        self.name=name
        self.sex=sex
        self.province=province
    @classmethod
    def aaa(cls):
        print('-----执行------')
    def sleep(self):
        print(f'{self.province}中叫{self.name},性别为{self.sex}的人在睡觉')
    def eat(self):
        print(f'{self.name}在吃东西')
aa=people('张三','男','吉林省')
print(aa.country)
print(aa.name)
people.aaa()
aa.sleep()